import SvgIcon from './SvgIcon/index.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import Category from './Category/index.vue'
const allGlobalComponents = { SvgIcon, Category }

// console.log(Object.keys(allGlobalComponents))

//对外暴露插件对象
export default {
    install(app:any) {
        const keys = Object.keys(allGlobalComponents) as (keyof typeof allGlobalComponents)[]
        keys.forEach((key) => {
          app.component(key, allGlobalComponents[key])
        })
        //注册element-plus图标为全局组件
        for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
          app.component(key, component)
        }
    }
}